import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import Layout from '@/components/layout/index.vue';


const routes: Array<RouteRecordRaw> = [{
    path: '/',
    component: Layout,
    redirect: '/home',
    hidden: false,
    children: [{
        path: '/home',
        name: 'Home',
        component: () => import('@/pages/home/index.vue'),
        meta: {
            title: "首页",
            icon: ''
        }
    }]
},
{
    path: '/login',
    name: 'Login',
    component: () => import('@/pages/login/index.vue'),
},
{
    path: '/:pathMatch(.*)*',
    component: () => import('@/pages/error/404.vue')
},
{
    path: '/401',
    component: import('@/pages/error/401.vue')
}
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router;